Merge pull request #1686 from dsander/fix-agent-params

`service_id` is a valid part of the agent_params

Dominik Sander лет %!s(int64=8): %!d(string=назад)
Родитель
Сommit
5868c7b4b2
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      app/controllers/application_controller.rb
  2. 1 1
      spec/controllers/agents_controller_spec.rb

+ 1 - 1
app/controllers/application_controller.rb

@@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base
65 65
     return {} unless params[:agent]
66 66
     @agent_params ||= begin
67 67
       options = params[:agent].delete(:options) if params[:agent][:options].present?
68
-      params[:agent].permit(:memory, :name, :type, :schedule, :disabled, :keep_events_for, :propagate_immediately, :drop_pending_events,
68
+      params[:agent].permit(:memory, :name, :type, :schedule, :disabled, :keep_events_for, :propagate_immediately, :drop_pending_events, :service_id,
69 69
                             source_ids: [], receiver_ids: [], scenario_ids: [], controller_ids: [], control_target_ids: []).tap do |agent_params|
70 70
         agent_params[:options] = options if options
71 71
       end

+ 1 - 1
spec/controllers/agents_controller_spec.rb

@@ -205,7 +205,7 @@ describe AgentsController do
205 205
 
206 206
     it "creates Agents and accepts specifing a target agent" do
207 207
       sign_in users(:bob)
208
-      attributes = valid_attributes
208
+      attributes = valid_attributes(service_id: 1)
209 209
       attributes[:receiver_ids] = attributes[:source_ids]
210 210
       expect {
211 211
         expect {